home *** CD-ROM | disk | FTP | other *** search
- PRODUCT(3I) Last changed: 4-13-99
-
-
- NNAAMMEE
- PPRROODDUUCCTT - Forms the product of array elements
-
- SSYYNNOOPPSSIISS
- PPRROODDUUCCTT (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, IRIX systems
-
- CF90, MIPSpro 7 Fortran 90
-
- SSTTAANNDDAARRDDSS
- Fortran
-
- DDEESSCCRRIIPPTTIIOONN
- The PPRROODDUUCCTT intrinsic function forms the product of all the elements
- of _a_r_r_a_y along dimension _d_i_m corresponding to the true elements of
- _m_a_s_k. It accepts the following arguments:
-
- _a_r_r_a_y Must be of type integer, real, or complex. It must not be
- scalar.
-
- _d_i_m Must be scalar and of type integer with a value in the range
- 1 <= _d_i_m <= _n, where _n is the rank of _a_r_r_a_y. The
- corresponding actual argument must not be an optional dummy
- argument.
-
- _m_a_s_k Must be of type logical and must be conformable with _a_r_r_a_y.
-
- PPRROODDUUCCTT is a transformational intrinsic function. The name of this
- intrinsic cannot be passed as an argument.
-
- RREETTUURRNN VVAALLUUEESS
- The result has the same type and type parameter as _a_r_r_a_y. The result
- is scalar if _d_i_m is absent or _a_r_r_a_y has rank one; otherwise, the
- result is an array of rank _n-1 of shape
- (_d , _d , ..., _d , _d , ..., _d ),
- 1 2 _d_i_m-1 _d_i_m+1 _n
- where (_d , _d , ..., _d )
- 1 2 _n
- is the shape of _a_r_r_a_y.
-
- The result of PPRROODDUUCCTT((_a_r_r_a_y)) has a value equal to the product of all
- the elements of _a_r_r_a_y or has the value 1 if _a_r_r_a_y has size 0.
-
- The result of PPRROODDUUCCTT((_a_r_r_a_y,,MMAASSKK==_m_a_s_k)) has a value equal to the
- product of the elements of _a_r_r_a_y corresponding to the true elements of
- _m_a_s_k or has the value 1 if there are no true elements.
-
- If _a_r_r_a_y has rank one, PPRROODDUUCCTT((_a_r_r_a_y,,_d_i_m[,,_m_a_s_k])) has a value equal to
- that of PPRROODDUUCCTT((_a_r_r_a_y[,,MMAASSKK==_m_a_s_k])). Otherwise, the value of element
- (_s , _s , ..., _s , _s , ..., _s )
- 1 2 _d_i_m-1 _d_i_m+1 _n
- of PPRROODDUUCCTT((_a_r_r_a_y,,_d_i_m[,,_m_a_s_k])) is equal to
- PPRROODDUUCCTT((_a_r_r_a_y (_s , _s , ..., _s , : , _s , ..., _s ))))
- 1 2 _d_i_m-1 _d_i_m+1 _n
- [,, MMAASSKK==_m_a_s_k ((_s , _s , ..., _s , : , _s , ..., _s ))])).
- 1 2 _d_i_m-1 _d_i_m+1 _n
- EEXXAAMMPPLLEESS
- Example 1: The value of PPRROODDUUCCTT((((// 11,, 22,, 33 //)))) is 6.
-
- Example 2: PPRROODDUUCCTT((CC,, MMAASSKK == CC ..GGTT.. 00..00)) forms the product of the
- positive elements of CC.
-
- Example 3: BB is the following array:
-
- | 1 3 5 |
-
- | 2 4 6 |
-
- PPRROODDUUCCTT((BB,, DDIIMM == 11)) is ((//22,, 1122,, 3300//)), and PPRROODDUUCCTT((BB,, DDIIMM == 22)) is ((//1155,,
- 4488//)).
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
- man page.
-